<template>
	<view>
		<view v-if="bjapplyList.length>0">
			<view class="search-title">
				<view>全部备件列表</view>
				<!-- <view>备件数量：16件</view> -->
			</view>
			<view class="search-list">
				<view class="search-item" v-for="(item,index) in bjapplyList" :key="index">
					<view class="item-top">
						<!-- <view class="item-name"> {{item.name}}</view> -->
						<view class="item-txt">
							<view class="left-icon">
								<image
									:src="item.partPicture?item.partPicture:'https://img.js.design/assets/smartFill/img429164da758808.jpg' ">
								</image>
								
							</view>
							<view class="right-txt">
								<view class="txt-left">
									<view class="txt1">{{item.partNum!=''?item.partNum+'-':''}}{{item.partName}}
									</view>
									<view class="txt-status">
										{{item.approveStatus==0?'待提交':item.approveStatus==1?'待审核':item.approveStatus==2?'已审核':''}}
									</view>
								</view>
								<view class="txt-right">
									<view class="txt2">{{item.partTypeName}}</view>
									<view class="addnum">
										<view class="total">共{{item.totalAmount}}件</view>
										<view class="iconfont icon-app-delete1 delete-btn"
											v-if="item.approveStatus==0" @click="deleteBjItem(item,index)"></view>
									</view>
								</view>
		
							</view>
						</view>
					</view>
		
				</view>
			</view>
			<view class="bx-list">
				<view class="bx-list-title" @click="togoPeopleSelect(5)">
					<view class="left">
						<view style="color: red;">*</view>审核人
					</view>
					<view class="right1">
						<!-- <view :class="[(wxpeopleList5&&wxpeopleList5.realName!='')?'select-bg':'']">
							{{(wxpeopleList5&&wxpeopleList5.realName!='')?wxpeopleList5.realName:'选择人员'}}
						</view> -->
						<view class="iconfont icon-app-xiangyou"></view>
					</view>
				</view>
			</view>
			<view class="search-btn" style="margin-top: 2rpx;">
				<view class="btn" @click="addBeijianChange">添加备件</view>
				<view class="btn" @click="$dianji(togoComfirApplybtn,'onoff')">提交申请</view>
			</view>
			<!-- <view class="bx-title2">
				提示：如果关联备件，需要审核通过后才可【提交】按钮
			</view> -->
		</view>
		<view class="not-data" v-if="bjapplyList.length==0">
			<image src="../../../static/images/index/noMenu.png" mode="widthFix"></image>
			<view class="txt1">暂未添加备件信息</view>
			<view class="txt2" @click="addBeijianChange">添加备件</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			bjapplyList: {
				type: Array,
				default () {
					return [];
				}
			},
		},
		data(){
			return{
				onoff:true
			}
		},
		onLoad() {
			
		},
		methods:{
			//添加备件
			addBeijianChange() {
				this.$emit("addBeijianChange")
			},
			//提交申请
			togoComfirApplybtn(){
				this.$emit("togoComfirApplybtn")
			}
		}
	}
</script>

<style lang="scss">
	.search-title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 24rpx;
		color: #8c8c8c;
		padding: 20rpx 30rpx;
	}
	
	.search-list {
		background: #fff;
		margin-top: 2rpx;
	
	
		.search-item {
			padding: 30rpx;
			border-bottom: 1px solid #f2f2f2;
	
			.item-top {
				display: flex;
				align-items: center;
	
				.item-name {
					color: #000000;
					font-size: 34rpx;
				}
	
				.item-txt {
					padding: 20rpx 0 20rpx 10rpx;
					display: flex;
					width: 100%;
	
					.left-icon {
						border-radius: 8rpx;
	
						image {
							width: 152rpx;
							height: 152rpx;
							border-radius: 8rpx;
						}
					}
	
					.right-txt {
						padding-left: 32rpx;
						width: 100%;
	
						.txt-left {
							display: flex;
							// align-items: center;
							justify-content: space-between;
	
							.txt1 {
								width: 400rpx;
								height: 75rpx;
								font-size: 34rpx;
								color: #000000;
								padding-bottom: 20rpx;
								overflow: hidden;
								text-overflow: ellipsis;
								display: -webkit-box;
								-webkit-box-orient: vertical;
								-webkit-line-clamp: 2;
							}
	
							.txt-status {
								font-size: 30rpx;
								color: #1962e0;
							}
						}
	
						.txt-right {
							display: flex;
							align-items: center;
							justify-content: space-between;
							padding-top: 10rpx;
	
							.txt2 {
								font-size: 28rpx;
								color: #8c8c8c;
							}
	
							.addnum {
								display: flex;
								align-items: center;
								font-size: 28rpx;
	
								.delete-btn {
									color: #fa4016;
									margin-left: 10rpx;
									font-size: 40rpx;
								}
	
								.total {
									color: #000000;
								}
							}
						}
					}
				}
	
			}
	
	
		}
	}
	.search-btn {
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 30rpx;
		background: #ffffff;
	
		.btn {
			border: 1px solid #0F53AC;
			color: #0F53AC;
			font-size: 34rpx;
			border-radius: 12rpx;
			padding: 20rpx 0;
			width: 40%;
			text-align: center;
	
		}
	}
</style>